function extractCurrencyValue(str) {
    let value = 0;
    let pos = str.indexOf(`$`, 0);
    value = Number(str.slice(pos+1, str.length));
    return value;
};

alert(extractCurrencyValue(`$120`) === 120);